package com.yc.edu.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author YC
 * @version 1.0
 * CREATE TABLE `post_info`
 * (
 * post_id 		VARCHAR(255) COMMENT '帖子id 主键',
 * user_id 		BIGINT(20) NOT NULL COMMENT '用户id',
 * user_name		VARCHAR(100) NOT NULL COMMENT '用户姓名',
 * user_avatar		VARCHAR(255) NOT NULL COMMENT '用户头像',
 * title 			VARCHAR(255) NOT NULL COMMENT '帖子标题',
 * content 		LONGTEXT NOT NULL COMMENT '帖子内容',
 * answer_count 		INT NOT NULL DEFAULT 0 COMMENT '帖子回复数',
 * ques_label 		VARCHAR(255) NULL COMMENT  '标签[逗号分割]',
 * PRIMARY KEY (post_id)
 * )CHARSET=utf8mb4 COMMENT '帖子表';
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("post_info")
public class PostInfo {
    @TableId(value = "post_id")
    private String postId;

    @TableField (value = "course_id")
    private Integer courseId;

    @TableField(value = "user_name")
    private String username;

    @TableField(value = "user_avatar")
    private String userAvatar;

    // 帖子标题
    private String title;

    // 帖子内容
    private String content;

    // 帖子标签
    @TableField("ques_label")
    private String quesLabel;

    // 帖子发布时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private String createTime;
}
